package cn.wolfcode.crm.web.controller;


import cn.wolfcode.crm.domain.Customer;
import cn.wolfcode.crm.query.CustomerQueryObject;
import cn.wolfcode.crm.service.ICustomerService;
import cn.wolfcode.crm.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("customerPool")
@Controller
public class CustomerPoolController {
    @Autowired
    private ICustomerService customerService;

    @Autowired
    private IEmployeeService employeeService;
    @RequestMapping("list")
    public String list(Model model,@ModelAttribute("qo") CustomerQueryObject qo) {
        // 资源池所有人都可以访问
        qo.setStatus(Customer.POOL_CUSTOMERS);
        model.addAttribute("pageInfo", customerService.queryForList(qo));
        model.addAttribute("emps", employeeService.selectAll());
        return "customer/listPool";
    }

}
